import request from '/@/utils/request'
import {module} from '/@/api/ums'

export default {
  getPage(data) {
    return request({
      url: module + '/opportunity/page',
      method: 'post',
      data
    })
  },
  createData(data) {
    return request({
      url: module + '/opportunity/add',
      method: 'post',
      data
    })
  },
  editData(data) {
    return request({
      url: module + '/opportunity/edit',
      method: 'post',
      data
    })
  },
  batchEdit(data) {
    return request({
      url: module + '/opportunity/batchEdit',
      method: 'post',
      data
    })
  },
  /**
   * 添加机会
   */
  addOpportunity(data) {
    return request({
      url: module + '/opportunity/addOpportunity',
      method: 'post',
      data
    })
  },
  /**
   * 客列表页金额统计表格数据
   */
  getSumAmount() {
    return request({
      url: module + '/opportunity/getAmountSum',
      method: 'get'
    })
  },
  /**
   * 根据客户id获取机会列表
   */
  listByCustomer(params) {
    return request({
      url: module + '/opportunity/listByCustomer',
      method: 'get',
      params
    })
  }
}
